package com.maxafaa.gravitydemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

public class MainActivity extends Activity {
	
	private MainSurfaceView mainsurfaceview;
	
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
	}
	
	@Override
	public void onStart(){
		super.onStart();
		requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        mainsurfaceview = new MainSurfaceView(this);		
		setContentView(mainsurfaceview);
	}
	
	@Override
	public void onStop(){
		super.onStop();
		MainActivity.this.finish();
	}
	
	@Override
	public void onBackPressed(){
		if(mainsurfaceview.RemoveAllBird() == false){
      	   MainActivity.this.finish();
		}
	}
}
